﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ESF.MUP.BasePlatform;

namespace ESF.MUP.BasePlatform.Factories
{
    public static class PlatformManagerFactory
    {

        /// <summary>
        /// Static constructor to initialize collections from the configuration file
        /// </summary>
        static PlatformManagerFactory()
        {
            //TODO : How change the section name to allow dynamic name
            AppDomain.CurrentDomain.TypeResolve += new ResolveEventHandler(CurrentDomain_TypeResolve);
            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);
            //AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = @"D:\Tools\MESF\Main\MiddlewareManager\ESF.MUP.Powershell\bin\Debug";
        }

        static System.Reflection.Assembly CurrentDomain_ReflectionOnlyAssemblyResolve(object sender, ResolveEventArgs args)
        {
            //throw new NotImplementedException();
            return System.Reflection.Assembly.GetCallingAssembly();
        }

        static System.Reflection.Assembly CurrentDomain_TypeResolve(object sender, ResolveEventArgs args)
        {
            //throw new NotImplementedException();
            return System.Reflection.Assembly.GetCallingAssembly();
        }





    }
}
